<?php
/**
 * Created by PhpStorm.
 * User: XZR
 * Date: 2018/8/1
 * Time: 15:21
 */

namespace Api\Controller;

use Common\Controller\BaseController;
use Common\Service\WeChatService;


class TestController extends BaseController
{
    public function getToken()
    {

        $array = [
            "touser" => "onwDm5Z3mJaUB9GWPK-OH_NhXcZU",
            "template_id" => "XbmvJqSp79mnU86Ww4b6rYkoUlM82i8Qt7ZfokdQ4Dg",
            "page" => "index",
            "data" => [
                "name2" => [
                    "value" => "test"
                ],
                "thing1" => [
                    "value" => "Test"
                ]
            ]
        ];
        echo json_encode($array);
        $res = (new WeChatService())->sendMsg($array);
        print_r($res);

    }

}